import { computed, defineComponent } from "vue";
import { useAuthStore } from "@/stores/modules/auth";
import c from './layout.module.less'
import { useRouter } from "vue-router";
import Main from '@/components/Main/main';
export default defineComponent({
  name: "Layout",
  setup() {
    const authStore = useAuthStore();
    const router = useRouter();
    const menuList = computed(() => authStore.authMenuListGet);
    const changeMain = (item: any) => {
      router.push(item.path);
    }
    return () => {
      return (
        <>
          <div class={c.layout}>
            <div class={c.left}>
              {menuList.value && menuList.value.map((item: any) => (
                <div onClick={() => changeMain(item)}>{item.meta.title}</div>
              ))}
            </div>
            <div class={c.right}>
              <Main />
            </div>
          </div>
        </>
      )
    }
  }
});
